#ifndef __VOLUMEUNIT_H__
#define __VOLUMEUNIT_H__

#include <string>
#include <iostream>
#include <vector>

typedef int Amount;

struct VolumeUnit
{
    struct UnitSeqVistor
    {
        virtual void
        access(const VolumeUnit*) = 0;
    };

    static const VolumeUnit&
    getTSP();

    static const VolumeUnit&
    getBSP();

    static const VolumeUnit&
    getOZ();

    static const VolumeUnit&
    getBaseUnit();

    static void
    vistorUnitSeq(UnitSeqVistor&);

    Amount
    convertToBaseUnit(const Amount &) const;

    Amount
    convertFromBaseUnit(const Amount& amountInBase) const;

    Amount
    convertOddmentFromBaseUnit(const Amount& amountInBase) const;

    bool
    operator>(const VolumeUnit&) const;

    friend std::ostream&
    operator<<(std::ostream&, const VolumeUnit&);

private:
    VolumeUnit(const Amount&, const std::string&);

    Amount factor_m;

    const std::string name_m;
};

std::ostream&
operator<<(std::ostream&, const VolumeUnit&);

#define TSP VolumeUnit::getTSP()
#define BSP VolumeUnit::getBSP()
#define OZ VolumeUnit::getOZ()

#endif

